<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>计算圆的半径、周长、面积</title>
	</head>
	<body>
		<input type="text" placeholder="半径" id="a"/>
		<input type="text" placeholder="周长" id="b"/>
		<input type="text" placeholder="面积" id="c"/>
		<script>
			var a = document.querySelector("#a");
			var b = document.querySelector("#b");
			var d = document.querySelector("#c");
			
			var r = prompt("请输入圆的半径");
			a.value = r;
			//console.log(r);
			//console.log(a.value);
			//根据圆的半径计算周长和面积
			//π
			var p = 3.14;
			console.log(p);
			//周长
			var c = 2*p*r;
			console.log(c);
			b.value = c;
			//面积p*r2
			var s = p * r * r;
			console.log(s);
			d.value = s;
		</script>
	</body>
</html>
